"""
@author: tian-yan-tian-ge
@file: 2023.11.17统计出现次数最多的字符，以及每个字符出现的次数都输出一下.py
@time: 2023/11/17 20:13
"""

str1 = input("请输入字符串:")
max_str = ""
tmp_str = ""
themax = 0
# 对字符串进行去重处理
for i in str1:
    if i not in tmp_str:
        tmp_str += str(i)

for i2 in tmp_str:
    str_count = str1.count(i2)
    if str_count > themax:
        themax = str_count
        max_str = i2
    print("字符%s出现的次数是%d" % (i2,str_count))
print("出现最多的字符是%s,出现的次数是%d" % (max_str,themax))



